/// @file
/// @author Chelsey Batchelor <vadedeyes@gmail.com>
/// @author Abraham Escamilla <abraham.escamilla@live.com>
/// @author Curtis Hollibaugh <curtis.hollibaugh@gmail.com>
/// @copyright Copyright 2014 Chelsey Batchelor <vadedeyes@gmail.com>
/// @copyright Copyright 2014 Abraham Escamilla <abraham.escamilla@live.com>
/// @copyright Copyright 2014 Curtis Hollibaugh <curtis.hollibaugh@gmail.com>
/// Contains the declaration of the GUI class.

#include <mutex>
#include <thread>

/// Creates and runs graphical user interface stuff.
class GUI {
	private:
		bool isRunning; ///< Whether or not the event loop is running.
		std::mutex isRunningMutex; ///< Mutex for managing access to isRunning.
		std::thread mainLoopThread; ///< Thread that the event loop runs in.
		
	public:
		/// Default constructor.
		GUI();
		
		/// Destructor.
		~GUI();
		
		/// Move contructor.
		/// @param [in] rhs GUI to move.
		GUI(GUI&& rhs) = default;
		
		/// Copy constructor.
		/// DELETED.
		/// @param [in] rhs GUI to copy.
		GUI(const GUI& rhs) = delete;
		
		/// Move assignment operator.
		/// @param [in] rhs GUI to move.
		/// @return This GUI after the assignment.
		GUI& operator=(GUI&& rhs) = default;
		
		/// Copy assignment operator.
		/// DELETED.
		/// @param [in] rhs GUI to copy.
		/// @return This GUI after the assignment.
		GUI& operator=(const GUI& rhs) = delete;
		
		/// Gets whether the event loop is running.
		/// @return true if the loop is running; false if not.
		bool IsRunning();
		
		/// Starts the event loop.
		/// Does not block execution, but instead it runs the loop in a new
		/// thread.
		void Start();
		
		/// Stops the event loop.
		/// DOES BLOCK EXECUTION until the event loop thread finishes.
		void Stop();
};
